<template>
  <div id="app">
    <h1>验证流程</h1>
    <router-link to="/login" v-if="!loggedIn">登录</router-link>
    <router-link to="/logout" v-if="loggedIn">登出</router-link>
    <router-view></router-view>
  </div>
</template>
<script>
import auth from './util/auth'

export default {
  data() {
    return {
      loggedIn:auth.loggedIn()
    }
  },
  created() {
    auth.onChangeStatus = (status)=>{
      this.loggedIn = status
    }
  }
}
</script>
<style>

</style>
